<html>
<head>
<meta name="Generator" content="QQ 80342014" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="<?php echo $this->_var['keywords']; ?>" />
<meta name="Description" content="<?php echo $this->_var['description']; ?>" />

<title><?php echo $this->_var['page_title']; ?></title>

<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<link href="<?php echo $this->_var['ecs_css_path']; ?>" rel="stylesheet" type="text/css" />

<?php echo $this->smarty_insert_scripts(array('files'=>'transport_jquery.js,common.js,user.js')); ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />

</head>
<body>
<?php echo $this->fetch('library/header.lbi'); ?>
<div class="y-content">
	<?php echo $this->fetch('library/tab.lbi'); ?>
<div id="wk-content">
<div class="y-box">
<!--  <a href="">
	<div class="y-project">
		<div class="y-state y-state1">
			抢购中
		</div>
		<div class="y-buy">
		<i class="y-yang"></i>
		<span>青山羊117只，按月分红&nbsp;&nbsp;第646期</span>
		</div>
		   <div class="y-buylist">
				<div class="y-buylist-a">
					<div>预期年分红</div>
					<div class="y-subnum">15.56%</div>
				</div>
				<div class="y-buylist-a">
					<div>每只/元</div>
					<div class="y-subnum">6000</div>
				</div>
				<div class="y-buylist-a y-buylist-b">
					<div>期限</div>
					<div class="y-subnum1">6个月</div>
				</div>
				<div class="y-circ  y-circ-back ">
					<canvas id="demo-3" class="canvas"></canvas>
				</div>
            </div>
			<div class="clear"></div>
	</div>
 </a> -->


</div>
</div>
 <div class="wk-height"></div>
 
	<?php echo $this->fetch('library/foot.lbi'); ?>
</div>

<link href="themes/view/css/dropload.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="themes/view/js/dropload.min.js"></script>
<script type="text/javascript" src="themes/view/js/waterbubble.js"></script>
<script type="text/javascript">
var w = f_size * 2.2;
var h = f_size * 2.2;
/*
$('#demo-3').css('width',w);
$('#demo-3').css('height',h);
$('#demo-3').waterbubble({waterColor: 'rgba(125,215,58,1)',txt: '20%',data:'0.9'});*/
</script>
<script>
$(function(){
   	  // 每页展示4个

		var size = 10;
		var page = 1;
 
    // dropload
    $('#wk-content').dropload({
        scrollArea : window,
        loadDownFn : function(me){ 
			var user = {
				page:page,
				size:size,
			}; 
            $.ajax({
                type: 'GET',
				data:user,
				url: 'sheep.php?act=ajaxlist', 
                dataType: 'json',
                success: function(result){ 
					console.log(result);
                    var str = ''; 
                    page = page + 1;	  /* 下一页  */
					lengths = result.lengths; /* 数组的长度 */
					lists = result.list;
					for(var i = 0; i < lengths; i++){  
					str += '<a href="'+ lists[i].url +'">'
						+'<div class="y-project">';
						if(lists[i].state == 1){
							str+='	<div class="y-state">' + lists[i].state_name +'	</div>';
						}
						else if(lists[i].state == 2){
							str+='	<div class="y-state y-state1">' + lists[i].state_name +'	</div>';
						}
						else if(lists[i].state == 3){
							str+='	<div class="y-state y-state2">' + lists[i].state_name +'	</div>';
						}
						 
						str+='	<div class="y-buy">'
						+'	<i class="y-yang"></i>'
						+'	<span>'+ lists[i].sheep_name +'&nbsp;&nbsp;第'+ lists[i].qishu +'期</span>'
						+'	</div>'
						+'	   <div class="y-buylist">'
						+'			<div class="y-buylist-a">'
						+'				<div>预期年分红</div>'
						+'				<div class="y-subnum">'+ lists[i].bonus +'%</div>'
						+'			</div>'
						+'			<div class="y-buylist-a">'
						+'				<div>每只/元</div>'
						+'				<div class="y-subnum">'+ lists[i].price +'</div>'
						+'			</div>'
						+'			<div class="y-buylist-a y-buylist-b">'
						+'				<div>期限</div>'
						+'				<div class="y-subnum1">'+ lists[i].cycle +'个月</div>'
						+'			</div>';
						if(lists[i].state > 1){
							str += '<div class="y-circ  y-circ-back ">'
								+'<canvas id="demo-'+ lists[i].sheep_id +'" class="canvas" style="width:'+ w +';height:'+ h +'" ></canvas>'
								+'</div>';
						}else{
							str += '<div class="y-circ y-circ-border">'
									+'<div class="y-rate">'+ lists[i].state_yue +'</div>'
									+'<div>'+ lists[i].state_shi +'</div>'
								+'</div>';
						
						} 
						
						str +='		</div>'
						+'		<div class="clear"></div>'
						+'</div>'
					+' </a>';

                    }
				
					if(!lengths){
						// 锁定
						me.lock();
						// 无数据
						me.noData();
					}
                    // 为了测试，延迟1秒加载
                    setTimeout(function(){
                        $('.y-box').append(str);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    },1000);
					 setTimeout(function(){
                        for(var a = 0; a < lengths; a++){  
							if(lists[a].state > 1){
								var textColor = 'rgb(0, 0, 0)';
								var data = '0';
								var text = '0%';
									text = lists[a].solds;
									data = lists[a].data;
									textColor = lists[a].textColor;
							 
								$('#demo-'+ lists[a].sheep_id).waterbubble({waterColor: 'rgba(125,215,58,1)',txt: text ,data:data,textColor:textColor});  
							}
						}
                    },1500);
						
					
                },
                error: function(xhr, type){
                    
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        }
    });
});
</script>
</body>
</html>